home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / cpu100.zip / CPU.DOC < prev    next >
Text File  |  1993-04-15  |  5KB  |  191 lines

  1.  
  2.  
  3.                CPU Toolkit Library
  4.  
  5.                   Version  1.00
  6.  
  7.  
  8.  
  9.                 Reference
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.              Written by Lindsay Vagg
  17.  
  18.              Copyright (C) 1993, Lindsay Vagg
  19.               Trading as Vaggabond Software.
  20.  
  21.                 10/522 Mowbray Rd.
  22.                Lane Cove, 2066, NSW, Sydney,
  23.                 Australia.
  24.  
  25.               (612) 975-1466 (Voice)
  26.                (612) 452-3493 (Fax)
  27.  
  28.  
  29.  
  30.                    Introduction
  31.  
  32.     CPU Library is a basic library of C runtime routines that
  33.     allow easy anaylasis of the Processor chip in your PC
  34.  
  35.     The CPU Library routines are written mainly in C with some portions
  36.     in Assembly language. The routines make use of C library functions
  37.     when possible and are compatible with TURBO C, TURBO C++, and 
  38.     BORLAND C++, although i would like to think that they will also
  39.     work with Microsoft C,  Microsoft QuickC. However, i'm not a big
  40.     enough fan to worry about testing that theory.
  41.  
  42.     CPU Library supports the five major memory models, all of which
  43.     are supplied here.
  44.  
  45.     TURBO C is a registered trademark of Borland International Inc.
  46.  
  47.     TURBO C++ is a registered trademark of Borland International Inc.
  48.  
  49.     BORLAND C++ is a registered trademark of Borland International Inc.
  50.  
  51.     Microsoft is a registered trademark, and QuickC is a trademark of
  52.     the Microsoft Corporation.
  53.  
  54.  
  55.  
  56.                 Registration
  57.  
  58.     None is required or even expected...or even wanted.
  59.     As you can probably tell, i've experienced Public Domain, Shareware
  60.     and Free Ware responses before.
  61.  
  62.     The registered version includes:
  63.  
  64.     ∙    This file.
  65.  
  66.     ∙    All five popular memory models.
  67.  
  68.     ∙    CPU.H header file.
  69.  
  70.     ∙    Sample C source (and EXE file) of the use of the Library.
  71.  
  72.     ∙    Sample batch file for compilation.
  73.  
  74.  
  75.  
  76.  
  77.     The Un-registered version includes:
  78.  
  79.     ∙    The same as above.
  80.  
  81.  
  82.  
  83.                 FUNCTIONS:
  84.  
  85.  
  86.     This is a list of all the functions in the CPU librarys. Each
  87.     is described in detail on the following pages. (The functions
  88.     are listed in alphabetical order by function name.)
  89.  
  90.     int cpu(void);
  91.  
  92.     char *cpuspeed(unsigned int round,unsigned int cputype);
  93.  
  94.     int isprot(void);
  95.  
  96.     int iswin(void);
  97.  
  98.  
  99.     =============================================================
  100.  
  101.     ┌──────────┐
  102.     │ cpu      │
  103.     └──────────┘
  104.  
  105.     Function:    Test the processor to determine its type.
  106.  
  107.     Syntax:        int cpu(void);
  108.  
  109.     Remarks:    Activates a number of assembler procedures to attempt
  110.             to determine the processor type and any details of a
  111.             co-processor.
  112.             Works with the following CPUs:-
  113.             8086/8088,80286,i386,i486
  114.  
  115.     Return:        CPU returns a value from 0 to 9.
  116.  
  117.     Table:        0 = Undetermined
  118.             1 = 8086/8088
  119.             2 = 8086/8088 with Coprocessor
  120.             3 = 80286
  121.             4 = 80286 with Coprocessor
  122.             5 = i386tm
  123.             6 = i386tm with 387 Coprocessor
  124.             7 = i386tm with 87/287 Coprocessor
  125.             8 = i486tm (SX)
  126.             9 = i486tm (DX) or i487tm (SX) with Coprocessor
  127.  
  128.  
  129.  
  130.     ┌──────────┐
  131.     │ cpuspeed │
  132.     └──────────┘
  133.     Function:    Test the processor speed in real MHz.
  134.  
  135.     Syntax:        char *cpuspeed(unsigned int round,unsigned int cputype);
  136.  
  137.     Remarks:    This function relys on the CPU() function to determine
  138.             firstly, detect the correct processor type to
  139.             accurately test the processors real MHz speed,
  140.             irrespective of its possible Turbo switch setting.
  141.             CPUTYPE, MUST be an accurate result from the CPU()
  142.             function.
  143.             If ROUND is set to 1, the result will be rounded to
  144.             a whole figure, otherwise the result will contain a
  145.             decimal point with decimal place precision.
  146.  
  147.     Return:        CPUSPEED returns a string containing the speed
  148.             in ASCII form.
  149.  
  150.     ┌──────────┐
  151.     │ isprot   │
  152.     └──────────┘
  153.     Function:    Test to see if the processor is operating in
  154.             Protected Mode.
  155.  
  156.     Syntax:        int isprot(void);
  157.  
  158.     Remarks:    Makes some tests to determine if the processor
  159.             is operating in a Protected Mode.
  160.  
  161.     Return:        ISPROT returns a value from 0 to 2.
  162.  
  163.     Table:        0 = Not in Protected mode
  164.             1 = Protected mode
  165.             2 = Protected mode via MS-Windows Enhanced mode
  166.  
  167.  
  168.  
  169.     ┌──────────┐
  170.     │ iswin    │
  171.     └──────────┘
  172.     Function:    Check if MS-Windows is currently active or not.
  173.  
  174.     Syntax:        int iswin(void);
  175.  
  176.     Remarks:    Tests the PC for some unique signatures and/or
  177.             interrupt responses to determine if MS-Windows
  178.             is active or if the program is running on just
  179.             plain old DOS.
  180.  
  181.     Return:        ISWIN returns a value from 0 to 6.
  182.  
  183.     Table:        0 = DOS
  184.             1 = Windows/386 2.x is running
  185.             2 = Windows 3.x is running in Enhanced mode
  186.             3 = Windows 4.x is running in Enhanced mode
  187.             4 = Windows/386 2.x is running
  188.             5 = Windows 3.0 is running in Real mode
  189.                 or Windows 3.1+ is running in Standard mode
  190.             6 = Windows 3.0 is running in Standard mode
  191.